using System;
using System.Text;
using System.Collections.Generic;
using iBeauty.BusinessObjects;
using iBeauty.DAL;

namespace iBeauty.BLL
{
	public class DiscountSettingBLL
	{
		private DiscountSettingDAO _DiscountSettingDAO;

		public DiscountSettingDAO DiscountSettingDAO
		{
			get { return _DiscountSettingDAO; }
			set { _DiscountSettingDAO = value; }
		}

		public DiscountSettingBLL()
		{
			DiscountSettingDAO = new DiscountSettingDAO();
		}
		public List<DiscountSetting> GetDiscountSettings()
		{
			try
			{
				return DiscountSettingDAO.GetDiscountSettings();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public DiscountSetting GetDiscountSetting(string ID)
		{
			try
			{
				return DiscountSettingDAO.GetDiscountSetting(ID);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddDiscountSetting(DiscountSetting oDiscountSetting)
		{
			try
			{
				return DiscountSettingDAO.AddDiscountSetting(oDiscountSetting);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddDiscountSetting(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string DiscountType,int? VisitNumber,Double? PayTotal,DateTime? Holiday,Double? DiscountMoney,Double? DiscountRate,string IsUse,int? AccountId,string Note)
		{
			try
			{
				return DiscountSettingDAO.AddDiscountSetting(ID,CreateDate,ModifiedDate,TimeStamp,DiscountType,VisitNumber,PayTotal,Holiday,DiscountMoney,DiscountRate,IsUse,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateDiscountSetting(DiscountSetting oDiscountSetting)
		{
			try
			{
				return DiscountSettingDAO.UpdateDiscountSetting(oDiscountSetting);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateDiscountSetting(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,string DiscountType,int? VisitNumber,Double? PayTotal,DateTime? Holiday,Double? DiscountMoney,Double? DiscountRate,string IsUse,int? AccountId,string Note)
		{
			try
			{
				return DiscountSettingDAO.UpdateDiscountSetting(ID,CreateDate,ModifiedDate,TimeStamp,DiscountType,VisitNumber,PayTotal,Holiday,DiscountMoney,DiscountRate,IsUse,AccountId,Note);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveDiscountSetting(DiscountSetting oDiscountSetting)
		{
			try
			{
				return DiscountSettingDAO.RemoveDiscountSetting(oDiscountSetting);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveDiscountSetting(string ID)
		{
			try
			{
				return DiscountSettingDAO.RemoveDiscountSetting(ID);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<DiscountSetting> DeserializeDiscountSettings(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<DiscountSetting>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeDiscountSettings(string Path, List<DiscountSetting> DiscountSettings)
		{
			try
			{
				GenericXmlSerializer<List<DiscountSetting>>.Serialize(DiscountSettings, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
